package com.vegetable.modules.entity.sys;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 系统消息
 *
 * @author Qoder
 */
@Data
@TableName("sys_message")
@ApiModel(value = "系统消息", description = "系统消息实体类")
public class SysMessageEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 消息ID
     */
    @ApiModelProperty(value = "消息ID", example = "1")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "message_id", type = IdType.AUTO)
    private Long messageId;

    /**
     * 消息标题
     */
    @ApiModelProperty(value = "消息标题", example = "系统维护通知")
    private String title;

    /**
     * 消息内容
     */
    @ApiModelProperty(value = "消息内容", example = "系统将于今晚00:00-02:00进行维护，请提前做好数据保存工作。")
    private String content;

    /**
     * 消息类型 1:系统消息 2:任务提醒 3:通知公告
     */
    @ApiModelProperty(value = "消息类型 1:系统消息 2:任务提醒 3:通知公告", example = "1")
    private Integer type;

    /**
     * 接收用户ID
     */
    @ApiModelProperty(value = "接收用户ID", example = "1")
    private Long receiverUserId;

    /**
     * 是否已读 0:未读 1:已读
     */
    @ApiModelProperty(value = "是否已读 0:未读 1:已读", example = "0")
    @TableField(value = "is_read")
    private Integer isRead;

    /**
     * 是否重要 0:普通 1:重要
     */
    @ApiModelProperty(value = "是否重要 0:普通 1:重要", example = "0")
    private Integer important;

    /**
     * 跳转链接
     * 当消息需要跳转到特定页面时，设置此字段
     * 用户点击消息时将跳转到指定URL
     */
    @ApiModelProperty(value = "跳转链接", example = "/page/detail.html?id=123")
    private String redirectUrl;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "2023-05-01 12:00:00")
    private Date createTime;

    /**
     * 读取时间
     */
    @ApiModelProperty(value = "读取时间", example = "2023-05-01 12:05:00")
    private Date readTime;
}